﻿@using OrganizationStructureTree.Areas.Default.Models.ViewModels
<ul class="nav pull-right">
    @if (Request.IsAuthenticated)
    {
        <text>
        <li>
            <a href="javascript:document.getElementById('logoutForm').submit()">Выход</a>
        </li>
        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, htmlAttributes: new { id = "logoutForm", @class = "navbar-form" }))
        {
            @Html.AntiForgeryToken()
        }
        </text>
    }
    else
    {
        <li class="dropdown">
            <a class="dropdown-toggle" href="#" data-toggle="dropdown">Восстановить пароль <strong class='caret'></strong></a>
        <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
            @{
                var options = new AjaxOptions() {HttpMethod = "POST", UpdateTargetId = "error-messages"};
            }
            @using (Ajax.BeginForm("Recovery", "Account", options, FormMethod.Post))
            {
                <div id="error-messages"></div>
                <input style="margin-bottom: 15px;" type="text" placeholder="Электронный адрес" id="recovery-mail" name="Email">
                <input class="btn btn-primary btn-block" type="submit" id="sign-in" value="Восстановить">
                }
        </div>
        </li>
        <li>@Html.ActionLink("Выполнить вход", "Login", "Account")</li>
        <li>@Html.ActionLink("Регистрация", "Register", "Account")</li>
    }
</ul>
